﻿@{
    ViewData["Title"] = "SM3";
}
<h1>@ViewData["Title"]</h1>




<div>
 
    <div>  内容：<textarea id="content" style="width:600px;">www.ruovea.com</textarea> </div>
    <div>  加密后：<textarea id="outtxt" style="width:600px;"></textarea> </div>

    <div>
        <input type="button" value="加密" onclick="doEncrypt();" />
       
    </div>
    <div>
     <br />sm3('abc')).toBe('66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0');
    <br /> sm3('abcdefghABCDEFGH12345678')).toBe('d670c7f027fd5f9f0c163f4bfe98f9003fe597d3f52dbab0885ec2ca8dd23e9b');
    <br /> sm3('abcdefghABCDEFGH12345678abcdefghABCDEFGH12345678abcdefgh')).toBe('1cf3bafec325d7d9102cd67ba46b09195af4e613b6c2b898122363d810308b11');
    <br /> sm3('abcdefghABCDEFGH12345678abcdefghABCDEFGH12345678abcdefghABCD')).toBe('b8ac4203969bde27434ce667b0adbf3439ee97e416e73cb96f4431f478a531fe');
    <br /> sm3('abcdefghABCDEFGH12345678abcdefghABCDEFGH12345678abcdefghABCDEFGH')).toBe('5ef0cdbe0d54426eea7f5c8b44385bb1003548735feaa59137c3dfe608aa9567');
    <br /> sm3('abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd')).toBe('debe9ff92275b8a138604889c18e5a4d6fdb70e5387e5765293dcba39c0c5732');
    </div>
    
</div>


@section Scripts {
@{ await Html.RenderPartialAsync("_Sm234ScriptsPartial"); }

<script>
 
    function doEncrypt(){
        var msgString=$("#content").val();
        let encryptData = sm3(msgString);
        $("#outtxt").val(encryptData);
    }
    
    </script>
}